import axios from '../utils/request';

class MetricsAPI {
  private baseUrl = '/metrics';

  // 创建系统指标
  createSystemMetric(metricData: any) {
    return axios.post(`${this.baseUrl}/system`, metricData);
  }

  // 创建性能指标
  createPerformanceMetric(metricData: any) {
    return axios.post(`${this.baseUrl}/performance`, metricData);
  }

  // 获取系统指标
  getSystemMetrics(params: any = {}) {
    return axios.get(`${this.baseUrl}/system`, { params });
  }

  // 获取性能指标
  getPerformanceMetrics(params: any = {}) {
    return axios.get(`${this.baseUrl}/performance`, { params });
  }
}

// 导出单例
export default new MetricsAPI();

